package models;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import play.data.validation.Email;
import play.data.validation.Unique;
import play.db.jpa.Model;

@Entity
@Table(name="user")
public class User extends Model{

	@Column(name="name")
	public String name;
	
	@Column(name="address")
	public String address;
	
	@Column(name="mail")
	@Email
	@Unique
	public String mail;
	
	@Column(name="phone")
	public String phone;
	
	@Column(name="password")
	public String password;
	
	@Transient
	public String passwordConfirmation;
	
	@ManyToOne
	public UserType userType;
	
	@OneToMany
	public List<Dream> dreams = new ArrayList<Dream>();
	
	@OneToMany
	public List<Proposal> proposals = new ArrayList<Proposal>();
	

}
